<template>
  <!-- 多语言翻译 -->
  <div>
    <el-dialog
      title="查看翻译"
      v-model="props.dialogVisible"
      width="600px"
      append-to-body
      @close="handleTranslationClose"
    >
    <el-table :data="proxy.languageList">
        <el-table-column label="语言类型" align="center">
          <template #default="scope">
            {{
              sys_language_type.find((code) => code.id === scope.row.languageId)?.description
            }}
          </template>
        </el-table-column>
        <el-table-column label="名称" :prop="props.name" align="center" />
        <el-table-column label="备注" prop="description" align="center" />
      </el-table>
    </el-dialog>
  </div>
</template>
<script setup >
import { ref, reactive, watch,defineEmits, onMounted } from "vue";
const { proxy } = getCurrentInstance();
const sys_language_type = ref([]); //来源语言列表
const emits = defineEmits([ "handleTranslationClose"]);
const props = defineProps({
    dialogVisible: {
    type: Boolean,
    default: false,
  },

  languageList: {
    type: Array,
    default: [],
  },
  name:{
    type: String,
    default: "name",
  },
})
onMounted(()=>{
  getLanguage()
})
// 语言列表
const getLanguage = () => {
  product.language.languageList().then((res) => {
    sys_language_type.value = res.data;
  });
};
const handleTranslationClose=()=>{
  emits("handleTranslationClose")
}
</script>